import * as actionTypes from "./actionTypes";
import {getDetails,getNewsList} from '../../../../apis/newslist';
import axios from 'axios';
export const getDetail = (data) => ({
    type: actionTypes.getDetail,
    data: data,
})
export const detail = ({id,type},fn) => {
    return (dispatch) => {
        axios.all([ getDetails({id,type}),getNewsList({id,type})]).then(axios.spread(function (getDetails, getNewsList) {
            console.log('getDetails, getNewsList',getDetails, getNewsList)
            let data={
                content: getDetails.data,
                list: getNewsList.data
            }
            dispatch(getDetail(data))
            fn();
        }))
    }
}
